<?php
/*	
	if(isset($_SESSION["refrescar"]) && $_SESSION["refrescar"]==1){
		$_SESSION["refrescar"]=0;
		echo "
		<script language=\"JavaScript\">
		<!--		
		 location.replace(\"Imagenes.php\")
		 -->
		</script>";
		
	}
*/

if ($_SESSION['Tipo']=='Hotel'){
	$profile=get_object_vars(unserialize($_SESSION['userProfile']));
	$idHotel = $profile['data']['id_procedencia'];
	$esHotel = true;
	
    $datos = getHotelData($idHotel);
	
	echo	"
		<form name=\"form\" id=\"formaHotelImagenes\" action=\"controladorHotel.php\" enctype=\"multipart/form-data\" method=\"post\">
		<input type=\"hidden\" value=\"actHotelImg\" name=\"accion\" />
		<input type=\"hidden\" value=\"7\" name=\"seccion\" />";
	
}else if ($_SESSION['Tipo']=='Operadora'){
	$boton = 'Dar de Alta';
	if($_REQUEST['accion'] == 'MHotel') $boton='Actualizar Datos';
	$idHotel = $_REQUEST['id'];
	$esOper = true;
}
	echo	"
		<table width=\"700\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
		  <tbody>";
	
	for($i = 1; $i < 6; $i++){
        echo "
			<tr>
				<td colspan=\"3\"> <hr> </td>
			</tr>
			<tr>
				<td class=\"formTitle\" align=\"right\">Fotograf&iacute;a {$i}:</td>
				<td class=\"formLabel\" valign=\"middle\">&nbsp;";
		if (strlen($datos['Foto'.$i]) != 0){
			echo "
					<img src=\"..\Comun\Images.php?Id_Hotel='".$datos['Id_Hotel']."'&Name='Foto{$i}'&random='".date('dmhis').rand(1,100)."'\" width='160' height='128' border='0'>";
		}else{
			echo "Actualmente sin imagen.";
		}
		echo "
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td colspan=\"2\">
					<input size=\"20\" name=\"fotos{$i}\" type=\"file\" align=\"absmiddle\"/>
				</td>
			</tr>
			";
	}

    echo "
		<tr>
			<td colspan=\"3\"> <hr> </td>
		</tr>
		<tr>
			<td class=\"formTitle\" align=\"right\">Croquis:</td>
			<td class=\"formLabel\" valign=\"middle\">&nbsp;";
	if (strlen($datos['Croquis']) != 0){
		echo "<img src=\"..\Comun\Images.php?Id_Hotel='".$datos['Id_Hotel']."'&Name='Croquis&random='".date('dmhis').rand(1,100)."'\" width='160' height='128' border='0'>";
	}else{
			echo "Actualmente sin imagen.";
	}
	echo "
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td colspan=\"2\">
				<input size=\"20\" name=\"croquis\" type=\"file\" />
			</td>
		</tr>
		</tbody>
	</table>";
	if($esHotel){
		echo "
		<br/> <center> <input type=\"submit\" value=\"Actualizar\"/> </center>";
	}else if($esOper){ 
		echo "
		<br/> <center> <input type=\"submit\" value=\"{$boton}\"/> </center>";
	}
	echo "
		</form>
	";
//		<br/> <center> <input type=\"button\" value=\"Actualizar\" onclick=\"validarNuevCuenta();\"/> </center>
?>